package com.jeesite.modules.backlog.service;

import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;

import com.alibaba.fastjson.JSONObject;
import com.jeesite.common.config.Global;
import com.jeesite.common.lang.DateUtils;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.modules.common.entity.SysBasicUser;
import com.jeesite.modules.sys.utils.UserUtils;
import com.jeesite.modules.task.action.entity.DcSupTaskAction;
import com.jeesite.modules.task.deploy.entity.DcSupTaskInfo;
import com.jeesite.modules.task.deploy.entity.OfficeUser;
import com.jeesite.modules.utils.OkHttpUtils;
import com.jeesite.modules.utils.SM3Utils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.backlog.entity.DcSupBacklog;
import com.jeesite.modules.backlog.dao.DcSupBacklogDao;

/**
 * 待办事项表Service
 * @author zrr
 * @version 2022-11-21
 */
@Service
@Transactional(readOnly=false)
public class DcSupBacklogService extends CrudService<DcSupBacklogDao, DcSupBacklog> {
	
	/**
	 * 获取单条数据
	 * @param dcSupBacklog
	 * @return
	 */
	@Override
	public DcSupBacklog get(DcSupBacklog dcSupBacklog) {
		return super.get(dcSupBacklog);
	}
	
	/**
	 * 查询分页数据
	 * @param dcSupBacklog 查询条件
	 * @return
	 */
	@Override
	public Page<DcSupBacklog> findPage(DcSupBacklog dcSupBacklog) {
		return super.findPage(dcSupBacklog);
	}
	
	/**
	 * 查询列表数据
	 * @param dcSupBacklog
	 * @return
	 */
	@Override
	public List<DcSupBacklog> findList(DcSupBacklog dcSupBacklog) {
		return super.findList(dcSupBacklog);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param dcSupBacklog
	 */
	@Override
	@Transactional(readOnly=false)
	public void save(DcSupBacklog dcSupBacklog) {
		super.save(dcSupBacklog);
	}
	
	/**
	 * 更新状态
	 * @param dcSupBacklog
	 */
	@Override
	@Transactional(readOnly=false)
	public void updateStatus(DcSupBacklog dcSupBacklog) {
		super.updateStatus(dcSupBacklog);
	}
	
	/**
	 * 删除数据
	 * @param dcSupBacklog
	 */
	@Override
	@Transactional(readOnly=false)
	public void delete(DcSupBacklog dcSupBacklog) {
		super.delete(dcSupBacklog);
	}

	/**
	 * 新增待办
	 */
	@Transactional(readOnly=false)
	public void add(DcSupBacklog dcSupBacklog){
		dcSupBacklog.setDataType("1");
		dcSupBacklog.setDataStatus("1");
		if(StringUtils.isBlank(dcSupBacklog.getReceiveUserCode())&&dcSupBacklog.getOfficeUser().size()>0){
			dcSupBacklog.setReceiveUserCode(dcSupBacklog.getOfficeUser().stream().map(OfficeUser::getUserCode).collect(Collectors.joining(",")));
			dcSupBacklog.setDataType("2");
		}
		super.save(dcSupBacklog);
	}

	@Transactional(readOnly=false)
	public DcSupBacklog add(String type1,String type2,String type3,String title,String content,String href,String org,String key,String type,String receiveUser,String taskId,String actionId){
		DcSupBacklog dcSupBacklog = new DcSupBacklog();
		dcSupBacklog.setBacklogType1(type1);
		dcSupBacklog.setBacklogType2(type2);
		dcSupBacklog.setBacklogType3(type3);
		dcSupBacklog.setBacklogTitle(title);
		dcSupBacklog.setBacklogContent(content);
		dcSupBacklog.setBacklogHref(href);
		dcSupBacklog.setOrgCode(org);
		dcSupBacklog.setBizKey(key);
		dcSupBacklog.setBizType(type);
		dcSupBacklog.setSendUserCode(StringUtils.isNotBlank(UserUtils.getUser().getUserCode())?UserUtils.getUser().getUserCode():"system");
		dcSupBacklog.setSendUserName(StringUtils.isNotBlank(UserUtils.getUser().getUserName())?UserUtils.getUser().getUserName():"系统管理员");
		dcSupBacklog.setReceiveUserCode(receiveUser);
		dcSupBacklog.setDataType("1");
		dcSupBacklog.setDataStatus("1");
		dcSupBacklog.setTaskId(taskId);
		dcSupBacklog.setActionId(actionId);
//		if(StringUtils.isNotBlank(receiveUser)){
			super.save(dcSupBacklog);
//		}
		return dcSupBacklog;
	}
	@Transactional(readOnly=false)
	public DcSupBacklog addOffice(String type1,String type2,String type3,String title,String content,String href,String org,String key,String type,List<OfficeUser> officeUser,String taskId,String actionId){
		DcSupBacklog dcSupBacklog = new DcSupBacklog();
		dcSupBacklog.setBacklogType1(type1);
		dcSupBacklog.setBacklogType2(type2);
		dcSupBacklog.setBacklogType3(type3);
		dcSupBacklog.setBacklogTitle(title);
		dcSupBacklog.setBacklogContent(content);
		dcSupBacklog.setBacklogHref(href);
		dcSupBacklog.setOrgCode(org);
		dcSupBacklog.setBizKey(key);
		dcSupBacklog.setBizType(type);
		dcSupBacklog.setSendUserCode(StringUtils.isNotBlank(UserUtils.getUser().getUserCode())?UserUtils.getUser().getUserCode():"system");
		dcSupBacklog.setSendUserName(StringUtils.isNotBlank(UserUtils.getUser().getUserName())?UserUtils.getUser().getUserName():"系统管理员");
		dcSupBacklog.setReceiveUserCode(","+officeUser.stream().map(OfficeUser::getUserCode).collect(Collectors.joining(","))+",");
		dcSupBacklog.setDataStatus("1");
		dcSupBacklog.setDataType("2");
		dcSupBacklog.setTaskId(taskId);
		dcSupBacklog.setActionId(actionId);
//		if(officeUser.size()!=0){
			super.save(dcSupBacklog);
//		}
		return dcSupBacklog;
	}
	@Transactional(readOnly=false)
	public DcSupBacklog addBasic(String type1,String type2,String type3,String title,String content,String href,String org,String key,String type,List<SysBasicUser> basicUser,String taskId,String actionId){
		DcSupBacklog dcSupBacklog = new DcSupBacklog();
		dcSupBacklog.setBacklogType1(type1);
		dcSupBacklog.setBacklogType2(type2);
		dcSupBacklog.setBacklogType3(type3);
		dcSupBacklog.setBacklogTitle(title);
		dcSupBacklog.setBacklogContent(content);
		dcSupBacklog.setBacklogHref(href);
		dcSupBacklog.setOrgCode(org);
		dcSupBacklog.setBizKey(key);
		dcSupBacklog.setBizType(type);
		dcSupBacklog.setSendUserCode(StringUtils.isNotBlank(UserUtils.getUser().getUserCode())?UserUtils.getUser().getUserCode():"system");
		dcSupBacklog.setSendUserName(StringUtils.isNotBlank(UserUtils.getUser().getUserName())?UserUtils.getUser().getUserName():"系统管理员");
		dcSupBacklog.setReceiveUserCode(","+basicUser.stream().map(SysBasicUser::getUserCode).collect(Collectors.joining(","))+",");
		dcSupBacklog.setDataStatus("1");
		dcSupBacklog.setDataType("2");
		dcSupBacklog.setTaskId(taskId);
		dcSupBacklog.setActionId(actionId);
//		if(basicUser.size()!=0){
			super.save(dcSupBacklog);
//		}
		return dcSupBacklog;
	}



//		DcSupBacklog dcSupBacklog = new DcSupBacklog();
//		dcSupBacklog.setBacklogType1();
//		dcSupBacklog.setBacklogType2();
//		dcSupBacklog.setBacklogType3();
//		dcSupBacklog.setBacklogTitle();
//		dcSupBacklog.setBacklogContent();
//		dcSupBacklog.setBacklogHref();
//		dcSupBacklog.setOrgCode();
//		dcSupBacklog.setBizKey();
//		dcSupBacklog.setBizType();
//		dcSupBacklog.setSendUserCode();
//		dcSupBacklog.setSendUserName();
//		//下面二选一
//		dcSupBacklog.setReceiveUserCode();
//		dcSupBacklog.setOfficeUser();

	/**
	 * 将待办置为已办
	 * @param bizKey
	 * @param bizType
	 * @param orgCode
	 */
	@Transactional(readOnly=false)
	public void doBacklog(String bizKey,String bizType,String orgCode){
		DcSupBacklog dcSupBacklog = new DcSupBacklog();
		dcSupBacklog.setBizKey(bizKey);
		dcSupBacklog.setBizType(bizType);
		dcSupBacklog.setOrgCode(orgCode);
		dcSupBacklog.setDealCode(UserUtils.getUser().getUserCode());
		dcSupBacklog.setDealName(UserUtils.getUser().getUserName());
//		List<DcSupBacklog> list = dao.getDoBacklog(dcSupBacklog);
//		for (int i = 0; i < list.size(); i++) {
//			String s = dealWZTPending(list.get(i).getId(), UserUtils.getUser().getExtend().getExtendS3());
//			updateWZTdealMessage2Bacnklog(list.get(i).getId(),s);
//		}
		dao.doBacklog(dcSupBacklog);
	}

	@Transactional(readOnly=false)
	public void updateBacklog(String taskId,String bizType,String orgCode,String receiveUserCode){
		DcSupBacklog dcSupBacklog = new DcSupBacklog();
		dcSupBacklog.setTaskId(taskId);
		dcSupBacklog.setBizType(bizType);
		dcSupBacklog.setOrgCode(orgCode);
		dcSupBacklog.setCreateDate(new Date());
		dcSupBacklog.setReceiveUserCode(","+receiveUserCode+",");
		String id2 = UUID.randomUUID().toString();
		List<DcSupBacklog> list = dao.getUpdateBacklog(dcSupBacklog);//获取旧的消息的id
		// TODO 删除皖政通待办,id用list中的
		dcSupBacklog.setRemarks(id2);
		dao.updateBacklog(dcSupBacklog);
		// TODO 新增皖政通待办,id用id2

	}

	@Transactional(readOnly=false)
	public void doBacklog(String bizKey,String bizType){
		DcSupBacklog dcSupBacklog = new DcSupBacklog();
		dcSupBacklog.setBizKey(bizKey);
		dcSupBacklog.setBizType(bizType);
		dcSupBacklog.setDealCode(UserUtils.getUser().getUserCode());
		dcSupBacklog.setDealName(UserUtils.getUser().getUserName());
//		List<DcSupBacklog> list = dao.getDoBacklog(dcSupBacklog);
//		for (int i = 0; i < list.size(); i++) {
//			String s = dealWZTPending(list.get(i).getId(), UserUtils.getUser().getExtend().getExtendS3());
//			updateWZTdealMessage2Bacnklog(list.get(i).getId(),s);
//		}
		dao.doBacklog(dcSupBacklog);
	}

	@Transactional(readOnly=false)
	public void doBacklogDate(String bizKey, String bizType, String endDateStr){
		try {
			Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(endDateStr);
			DcSupBacklog dcSupBacklog = new DcSupBacklog();
			dcSupBacklog.setBizKey(bizKey);
			dcSupBacklog.setBizType(bizType);
			SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");//设置格式
			Calendar calendar = Calendar.getInstance(); //创建Calendar 的实例
			calendar.setTime(date);
			calendar.add(Calendar.DAY_OF_MONTH, -1); //当前时间减去一天，即一天前的时间
			dcSupBacklog.setCreateDateStr(simpleDateFormat.format(calendar.getTime()));
			dcSupBacklog.setDealCode(UserUtils.getUser().getUserCode());
			dcSupBacklog.setDealName(UserUtils.getUser().getUserName());
//			List<DcSupBacklog> list = dao.getDoBacklog(dcSupBacklog);
//			for (int i = 0; i < list.size(); i++) {
//				String s = dealWZTPending(list.get(i).getId(), UserUtils.getUser().getExtend().getExtendS3());
//				updateWZTdealMessage2Bacnklog(list.get(i).getId(),s);
//			}
			dao.doBacklog(dcSupBacklog);
		}catch (Exception e){
		}
	}

	public List<DcSupBacklog> getList(DcSupBacklog dcSupBacklog){
		dcSupBacklog.setReceiveUserCode(UserUtils.getUser().getUserCode());
		List<DcSupBacklog> list = dao.getList(dcSupBacklog);
		for (DcSupBacklog log :list) {
			log.setBacklogHref(log.getBacklogHref().substring(2));
		}
		return list;
	}
	public Page<DcSupBacklog> getPage(DcSupBacklog dcSupBacklog){
		dcSupBacklog.setReceiveUserCode(UserUtils.getUser().getUserCode());
		List<DcSupBacklog> list = dao.getList(dcSupBacklog);
		for (DcSupBacklog log :list) {
			log.setBacklogHref(log.getBacklogHref().substring(2));
		}
		return dcSupBacklog.getPage().setList(list);
	}

	/**
	 * 查询传入用户的待办信息
	 * @param dcSupBacklog
	 * @return
	 */
	public Page<DcSupBacklog> getListByUserCode(DcSupBacklog dcSupBacklog){
		List<DcSupBacklog> list = dao.getListByUserCode(dcSupBacklog);
		return dcSupBacklog.getPage().setList(list);
	}

	/**
	 * 查询传入用户的待办信息
	 * @param receiveUserCode
	 * @return
	 */
	public Integer getCountByUserCode(String receiveUserCode){
		return dao.getCountByUserCode(receiveUserCode);
	}

    public Page<DcSupBacklog> getDetailPage(DcSupBacklog dcSupBacklog) {
		//获取info标的数据
		DcSupTaskInfo info = dao.getInfo(dcSupBacklog.getTaskId());
		//获取action标的数据
		List<DcSupTaskAction> actionList = dao.getActionList(dcSupBacklog);

		List<DcSupBacklog> res = new ArrayList<>();
		if(actionList.size()==0){
			res = dao.getDetailPage(dcSupBacklog.getTaskId());
			if(res.size()==0){
				return dcSupBacklog.getPage().setList(res);
			}
			res.get(0).setLeaderOrgName(info.getTaskLeaderOrgName());
			if(StringUtils.equals(info.getTaskStatus(),"5")){
				res.get(0).setReceiveUserCode("秘书一科成员");
			}
			if(StringUtils.equals(info.getNormalFlag(),"3")&&!StringUtils.equals("task_audit_deploy",res.get(0).getRemarks())&&!StringUtils.equals("task_deploy",res.get(0).getRemarks())){
				res = dao.getDetailPage3(dcSupBacklog.getTaskId());
			}
		}else{
			res = dao.getDetailPage2(dcSupBacklog.getTaskId());
			for (int i = 0; i < res.size(); i++) {
				if (StringUtils.equals(res.get(i).getTaskStatus(), "2")) {
					res.get(i).setBacklogType3("任务已接收");
				}
				if (StringUtils.equals(res.get(i).getTaskStatus(), "3")) {
					if("task_feedback".equals(res.get(i).getBizType())){
						res.get(i).setBacklogType3("任务待反馈");
					}
					if("task_audit_feedback".equals(res.get(i).getBizType())){
						res.get(i).setBacklogType3("任务已反馈待审核");
					}
				}
				if (StringUtils.equals(res.get(i).getTaskStatus(), "4")) {
					res.get(i).setBacklogType3("已结束");
					res.get(i).setReceiveUserCode("");
				}
			}
			if(StringUtils.equals(info.getNormalFlag(),"3")){
				res.addAll(dao.getDetailPage4(dcSupBacklog.getTaskId()));
			}
		}
		return dcSupBacklog.getPage().setList(res);
    }

	public Page<DcSupTaskAction> getActionList(DcSupTaskAction action) {
		DcSupBacklog dcSupBacklog = new DcSupBacklog();
		BeanUtils.copyProperties(action,dcSupBacklog);
		List<DcSupTaskAction> actionList = dao.getActionList(dcSupBacklog);

		return action.getPage().setList(actionList);
	}


	public List<DcSupBacklog> getDetailList(String id) {
		return dao.getDetailList(id);
	}

	/**
	 * 把皖政通新增接口返回的信息更新到待办表中
	 * @param id
	 * @param message
	 */
	public void updateWZTaddMessage2Bacnklog(String id,String message){
		dao.updateWZTaddMessage2Bacnklog(id,message);
	}

	/**
	 * 把皖政通完成待办接口返回的信息更新到待办表中
	 * @param id
	 * @param message
	 */
	public void updateWZTdealMessage2Bacnklog(String id,String message){
		dao.updateWZTdealMessage2Bacnklog(id,message);
	}


	/**
	 * 新增皖政通待办
	 * @param data 传id,title,message,发送人senderId,senderName
	 * @param userStr 传接收人userCode
	 * @return
	 */
	public String addWZTPending(Map<String,String> data,String userStr){
		try {
			List<Map<String,String>> user = new ArrayList<>();
			if(userStr.contains(",")){//存在逗号
				String [] userArr = userStr.split(",");
				for (int i = 0; i < userArr.length; i++) {
					Map<String,String> map = new HashMap<>();
					map.put("userId",UserUtils.get(userArr[i]).getExtend().getExtendS3());
					map.put("userName",UserUtils.get(userArr[i]).getUserName());
					user.add(map);
				}

			}else{
				Map<String,String> map = new HashMap<>();
				map.put("userId",UserUtils.get(userStr).getExtend().getExtendS3());
				map.put("userName",UserUtils.get(userStr).getUserName());
				user.add(map);
			}


			//获取header必须的参数  x-tif-paasid  x-tif-timestamp  x-tif-nonce  x-tif-signature
			String db_url = Global.getConfig("platform.wzt.ipport");
			String paasid = Global.getConfig("platform.wzt.passid");
			String timestamp = System.currentTimeMillis()/1000+"";
			String token = Global.getConfig("platform.wzt.token");
			String nonce = UUID.randomUUID().toString().replace("-","");
			//sha256(x-rio-timestamp + Token + x-rio-nonce + x-rio-timestamp)
			String signatureString = timestamp+token+nonce+timestamp;
			String signature = SM3Utils.getsha256(signatureString);
			Map<String,String> header = new HashMap<>();
			header.put("x-tif-paasid",paasid);
			header.put("x-tif-timestamp",timestamp);
			header.put("x-tif-nonce",nonce);
			header.put("x-tif-signature",signature);
			//调用皖政通新增接口
			Map<String,Object> dataMap = new HashMap<>();
			dataMap.put("appCode",Global.getConfig("platform.wzt.appCode"));//新增时必填，一体化平台发布时生成的应用ID（皖政通运营人员提供）
			dataMap.put("appName","智慧督查");//新增时必填，所属系统名称
			dataMap.put("vendorId",data.get("id"));//新增时必填，第三方系统待办主键
			dataMap.put("source","1");//新增时必填，来源类型1：第三方
			dataMap.put("title",data.get("title"));//新增时必填，标题
			dataMap.put("message",data.get("message"));//新增时必填,待办描述
			dataMap.put("content","");//办理提示内容
			dataMap.put("kind","8");//新增时必填，待办类型1：公文待办，2：公文待阅，3：邮件，4：会议，5：审批 6：监督 7. 考勤8. 其他
			dataMap.put("priority","2");//新增时必填，紧急程度1-特提、2-特急、3-加急、4-平急、5-普通
			dataMap.put("appUrl","http://10.1.50.222:16667/h5");//新增时必填，移动端处理链接 http://xxxxx
			dataMap.put("pcUrl","http://10.1.50.222:16667/whdc/a");//新增时必填，PC端处理链接 http://xxxxx
			dataMap.put("syncStatusUrl","http://10.1.50.222:16666/whdc/a");//新增时必填，处理状态同步 url
			dataMap.put("senderId",data.get("senderId"));//新增时必填，发送人竹云id
			dataMap.put("senderName",data.get("senderName"));//新增时必填，发送人名
			dataMap.put("onlyForOperator","1");//新增时必填，是否仅对执行人展示1-是，2-否
			dataMap.put("infoType","1");//新增时必填，待办通知类型;1- 站内信， 2-短信
			dataMap.put("startTime", DateUtils.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss"));//新增时必填，待办开始时间 时间格式 ： yyyy-MM-dd HH:mm:ss
			dataMap.put("endTime","2099-12-12 23:59:59");//新增时必填，待办截止时间 时间格式 ： yyyy-MM-dd HH:mm:ss
			dataMap.put("executorList",user);//新增时必填，执行人信息集，格式[{userId:"",userName:""}]
			dataMap.put("relativerList",new ArrayList<>());//相关人信息集，格式[{userId:"",userName:""}]


			JSONObject json = new JSONObject(dataMap);
			String dataStr = json.toJSONString();

			String s = OkHttpUtils.httpPostWZT(db_url + "/moap/restful/todo/settingPendingInfo/put", dataStr, header);
			System.out.println(s);
			return s;
		}catch(Exception e){
			return "失败";
		}

	}

	/**
	 * 皖政通待办置为已办
	 * @param vendorId 待办表id
	 * @param bambooUserId 竹云用户id
	 * @return
	 */
	public String dealWZTPending(String vendorId,String bambooUserId){
		try{
			//获取header必须的参数  x-tif-paasid  x-tif-timestamp  x-tif-nonce  x-tif-signature
			String db_url = Global.getConfig("platform.wzt.ipport");
			String paasid = Global.getConfig("platform.wzt.passid");
			String timestamp = System.currentTimeMillis()/1000+"";
			String token = Global.getConfig("platform.wzt.token");
			String nonce = UUID.randomUUID().toString().replace("-","");
			//sha256(x-rio-timestamp + Token + x-rio-nonce + x-rio-timestamp)
			String signatureString = timestamp+token+nonce+timestamp;
			String signature = SM3Utils.getsha256(signatureString);
			Map<String,String> header = new HashMap<>();
			header.put("x-tif-paasid",paasid);
			header.put("x-tif-timestamp",timestamp);
			header.put("x-tif-nonce",nonce);
			header.put("x-tif-signature",signature);

			Map<String,Object> dataMap = new HashMap<>();
			dataMap.put("appCode",Global.getConfig("platform.wzt.appCode"));//一体化平台发布时生成的应用ID（皖政通运营人员提供）
			dataMap.put("vendorId",vendorId);//三方业务系统待办 id
			dataMap.put("bambooUserId",bambooUserId);//当前登录的竹云用户 ID

			JSONObject json = new JSONObject(dataMap);
			String dataStr = json.toJSONString();

			String s = OkHttpUtils.httpPostWZT(db_url + "/moap/restful/todo/settingPendingInfo/deal-pending", dataStr, header);
			System.out.println(s);
			return s;
		}catch(Exception e){
			return "失败";
		}
	}

	/**
	 * 删除待办已办
	 * @param vendorId
	 * @param bambooUserId
	 * @return
	 */
	public String deleteWZTPending(String vendorId,String bambooUserId){
		try{
			//获取header必须的参数  x-tif-paasid  x-tif-timestamp  x-tif-nonce  x-tif-signature
			String db_url = Global.getConfig("platform.wzt.ipport");
			String paasid = Global.getConfig("platform.wzt.passid");
			String timestamp = System.currentTimeMillis()/1000+"";
			String token = Global.getConfig("platform.wzt.token");
			String nonce = UUID.randomUUID().toString().replace("-","");
			//sha256(x-rio-timestamp + Token + x-rio-nonce + x-rio-timestamp)
			String signatureString = timestamp+token+nonce+timestamp;
			String signature = SM3Utils.getsha256(signatureString);
			Map<String,String> header = new HashMap<>();
			header.put("x-tif-paasid",paasid);
			header.put("x-tif-timestamp",timestamp);
			header.put("x-tif-nonce",nonce);
			header.put("x-tif-signature",signature);

			Map<String,Object> dataMap = new HashMap<>();
			dataMap.put("appCode",Global.getConfig("platform.wzt.appCode"));//一体化平台发布时生成的应用ID（皖政通运营人员提供）
			dataMap.put("vendorId",vendorId);//三方业务系统待办 id
			dataMap.put("bambooUserId",bambooUserId);//当前登录的竹云用户 ID

			JSONObject json = new JSONObject(dataMap);
			String dataStr = json.toJSONString();

			String s = OkHttpUtils.httpPostWZT(db_url + "/moap/restful/todo/settingPendingInfo/delete-pending", dataStr, header);
			System.out.println(s);
			return s;
		}catch(Exception e){
			return "失败";
		}
	}
}